import http from '@/utils/http.js';

export default {
    getCourseInfo(params) {
        return http.get(`/manage/course/info`, {params})
    },
    pageCourse(params) {
        return http.get('/manage/course/page', {
            params
        })
    },
    listAdminCourse() {
        return http.get('/manage/course/list-admin')
    },
    listCourseByIds(params) {
        return http.get('/manage/course/list-by-ids', {params})
    },

    saveCourse(courseDTO) {
        return http.post(`/manage/course/create`,courseDTO)
    },
    updateCourse(courseDTO) {
        return http.post(`/manage/course/update`,courseDTO)
    },
    publishCourse(params) {
        return http.get(`/manage/course/publish`, {params})
    },
    getChapterSection({id}) {
        return http.get(`/manage/course/getChapterSectionByCsId`, {
            params: {
                id
            }
        })
    },

    getCourseList(name){
        return http.get('/manage/course/list', {
            params:{name}
        })
    },

    getCourseUserAnalysis(query){
        return http.get('/manage/course/user/progress/page', {
            params: query
        })
    },

    syncCourseUserRecord(){
        return http.get('/manage/course/user/progress/sync', )
    },

    getCourseUserRecordInfo(params){
        return http.get('/manage/course/user/progress/info', {
            params
        })
    },

    querySectionContentBySectionId(params) {
        return http.get('/manage/section/content/query-by-sectionId', {params})
    },

    /****************************课程框架管理*******************************/
    getBindAllInfo({courseId}){
        return http.get(`/manage/course/bindAllInfo`,{
            params: {
                courseId
            }
        })
    },
    getChapterList({id}) {
        return http.get('/manage/chapter/getChapterList', {
            params: {
                id
            }
        })
    },
    bindCourseChapter({courseId, chapters}) {
        return http.post('/manage/course/bindChapters', {
            courseId: courseId,
            chapters: chapters
        })
    },
    bindCourseChapterAndNext({courseId, chapters}) {
        return http.post('/manage/course/bindChaptersAndNext', {
            courseId: courseId,
            chapters: chapters
        })
    },

    /****************************毛细血管级课程管理***************************/
    addChapter(data){
        return http.post('/manage/course/addChapter', data)
    },
    addSection(data){
        return http.post('/manage/course/addSection', data)
    },
    addSectionContent(data){
        return http.post('/manage/course/addSectionContent', data)
    },


    removeChapter(params){
        return http.get('/manage/course/deleteChapter', {
            params
        })
    },
    removeSection(params){
        return http.get('/manage/course/deleteSection', {
            params
        })
    },
    removeSectionContent(params){
        return http.get('/manage/course/deleteSectionContent', {
            params
        })
    },



    upChapter(params){
        return http.get('/manage/course/upChapter', {
            params
        })
    },
    upSection(params){
        return http.get('/manage/course/upSection', {
            params
        })
    },
    upExam(params){
        return http.get('/manage/course/upExam', {
            params
        })
    },
    upSectionContent(params){
        return http.get('/manage/course/upSectionContent', {
            params
        })
    },

    updateChapterName(params){
        return http.get('/manage/course/updateChapterName', {
            params
        })
    },
    updateSectionName(params){
        return http.get('/manage/course/updateSectionName', {
            params
        })
    },
    updateSectionContent(data){
        return http.post('/manage/course/updateSectionContent', data)
    },










    /*******用户相关*******/
    bindCourse(bindInfo) {
        return http.post('/manage/course/user/bind', bindInfo)
    },
    unbindCourse(params) {
        return http.get('/manage/course/user/unbind', {params})
    },
    courseUserPage(params) {
        return http.get('/manage/course/user/page', {
            params
        })
    },
    updateCourseUserRole(params){
        return http.get('/manage/course/user/updaterole', {
            params
        })
    },
    BatchBindCourse(bindInfo) {
        return http.post('/manage/course/user/batch-bind', bindInfo)
    },
    queryTeam(data){
        return http.post('/manage/team/page-query', data)
    },

    getUserRising(params){
        return http.get('/manage/course/user/rising', {
            params
        })
    },



    /**举报审核相关*********/
    pageCheckList(params) {
        return http.get(`/admin/audit/check/list`,{
            params
        })
    },
    pageReportList(params) {
        return http.get(`/admin/audit/report/list`,{
            params
        })
    },
    upgrade(data) {
        return http.post('/admin/audit/upgrade',data)
    },


    /******回滚操作********/
    rollbackSectionContent(data){
        return http.post('/manage/course/rollback/sectionContent', data)
    },

    /******评论相关********/
    courseCommentsPage(params) {
        return http.get('/manage/section-content/comment/page', {
            params
        })
    },
    commentUpdate(data) {
        return http.post('/manage/section-content/comment/update',data)
    },

    /******箴言相关********/
    courseTalkPage(params) {
        return http.get('/manage/section/talk/page', {
            params
        })
    },
    talkUpdata(data) {
        return http.post('/manage/section/talk/updata',data)
    },

    /**********隧道相关**************/
    pageTunnelList(params) {
        return http.get(`/manage/tunnel/list`,{
            params
        })
    },
    getTunnelMessageInfo(params) {
        return http.get(`/manage/tunnel/message-list`, {
            params
        })
    },
}
